package org.example.loadbalancer;

import org.example.model.ServiceMetaInfo;

import java.util.List;
import java.util.Map;

/**
 * @description 负载均衡
 * @author sats@jz
 * @date 2025年01月13日 14:11
 */
public interface LoadBalancer {


//     static ServiceMetaInfo beforeSelect(Map<String, Object> requestParams, List<ServiceMetaInfo> serviceMetaInfoList) {
//        if (serviceMetaInfoList.isEmpty()){
//            return null;
//        }
//
//        // 只有一个服务不需要轮询
//        int size = serviceMetaInfoList.size();
//        if(size == 1){
//            return serviceMetaInfoList.get(0);
//        }
//        return null;
//    }
    // 选择服用调用
    ServiceMetaInfo select(Map<String, Object> requestParams, List<ServiceMetaInfo> serviceMetaInfoList);

}
